home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / MW MPW Binaries 1.1.1a2 / mwcPPC / MWCIncludes / new < prev    next >
Encoding:
Text File  |  1994-06-22  |  1.4 KB  |  65 lines  |  [TEXT/MMCC]

  1. // new standard header
  2. #if !__MWERKS__
  3.  
  4. #ifndef _NEW_
  5. #define _NEW_
  6. #include <exception>
  7.         // class xalloc
  8. class xalloc : public xruntime {
  9. public:
  10.     xalloc(const char * = 0, const char * = 0,
  11.         const char * = 0);
  12.     virtual ~xalloc();
  13. protected:
  14.     virtual void do_raise();
  15.     };
  16.         // function and object declarations
  17. fvoid_t *set_new_handler(fvoid_t *);
  18. void operator delete(void *);
  19. void *operator new(size_t);
  20. inline void *operator new(size_t, void *_P)
  21.     {return (_P); }
  22. #if _HAS_ARRAY_NEW
  23. void operator delete[](void *);
  24. void *operator new[](size_t);
  25. inline void *operator new[](size_t, void *_P)
  26.     {return (_P); }
  27. #endif
  28. extern fvoid_t (*_New_hand);
  29. #endif
  30.  
  31. #else /* __MWERKS__ */
  32.  
  33. #ifndef __NEW__
  34. #define __NEW__
  35.  
  36. #ifndef __STDDEF__
  37. #include <stddef.h>
  38. #endif
  39.  
  40. #include <exception>
  41.         // class xalloc
  42. class xalloc : public xruntime {
  43. public:
  44.     xalloc(const char * = 0, const char * = 0,
  45.         const char * = 0);
  46.     virtual ~xalloc();
  47.     };
  48.  
  49. extern void (*set_new_handler (void (*) ())) ();
  50. extern void *operator new(size_t size,void *p);
  51.  
  52. //    non-standard functions
  53. extern void _set_newpoolsize(size_t);        //    default: 0x00010000L
  54. extern void _set_newnonptrmax(size_t);        //    default: 0x00001000L
  55. extern char _prealloc_newpool(size_t);        //    preallocte a new buffer
  56.  
  57. #endif
  58.  
  59. #endif /* __MWERKS__ */
  60. /*
  61.  * Copyright (c) 1994 by P.J. Plauger.  ALL RIGHTS RESERVED. 
  62.  * Consult your license regarding permissions and restrictions.
  63.  */
  64.  
  65.